<extend name="Public:iframe" />
<block name="content">
    <form class="layui-form" action="">
        <div class="layui-form-item">
            <label class="layui-form-label">用户名</label>
            <div class="layui-input-block">
                <input type="hidden" name="id" value="{$info.id}">
                <span style="line-height: 37px;">{$info.username}</span>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">所属权限</label>
            <div class="layui-input-block">
                <select name="auth_group" lay-verify="required">
                    <option value=""></option>
                    <volist name="auth" id="au">
                        <option value="{$au.id}"
                         <if  condition="$au.id eq $info.auth_group_id"> selected </if>
                        >{$au.name}</option>
                    </volist>
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button type="button" class="layui-btn" lay-submit lay-filter="save">保存</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>

</block>

<block name="foot_script">
    <script>
        $(layui.use(['layer','form','upload','table'], function(){
            var table = layui.table, layer = layui.layer,form = layui.form,upload = layui.upload;


            form.on('submit(save)',function (data) {
                $.post('{:U("Adminrole/memedit")}',data.field,function (res) {
                    if (res.code === 1){
                        layer.msg(res.msg,{time:1000},function () {
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                            parent.layui.table.reload('dataMember');
                        });
                    } else {
                        layer.msg(res.msg,{time:1000});
                    }
                });
                return false;
            });

        }));

    </script>
</block>